#!/usr/bin/env python
import cv2
import numpy as np
from operator import mod
from math import ceil
import sys,os

try:
    mediafile = sys.argv[1]
except:
    mediafile = '00000000987000500.mp4'


media = cv2.VideoCapture(mediafile)
fps = media.get(cv2.CAP_PROP_FPS)
frames = int(media.get(cv2.CAP_PROP_FRAME_COUNT))
end_time = frames//25
end_sec = mod(end_time,60)
end_min = end_time // 60
if end_min >= 60:
    end_min = mod(end_min, 60)
end_hour = end_time // 3600
_,image = media.read()

shape = image.shape
height = shape[0]
width = shape[1]

print('fps = ', int(fps))
total_s = int(media.get(cv2.CAP_PROP_FRAME_COUNT))
print("total_s = ", total_s)
print(''.join(["total time is: ",str(end_hour).zfill(2),':',str(end_min).zfill(2),':',str(end_sec).zfill(2)]))
print(''.join(["video size is: ",str(height),'x',str(width)]))
